package com.zeildx.glife;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

@Dao
public interface EventDao {
    @Insert
    void insertEvents(Event... Events);

    @Update
    void updateEvents(Event...Events);

    @Delete
    void deleteEvents(Event...Events);

    @Query("DELETE FROM EVENT")
    void deleteAllEvents();

    @Query("SELECT * FROM EVENT ORDER BY ID DESC")
    LiveData<List<Event>> getAllEventsLive();

}
